<!-- 快捷缴费 -->
<template>
	<uni-card :is-shadow="false">
		<uni-forms ref="formref" :modelValue="formdata" :rules="formrules" label-width="100">
			<uni-forms-item label="户号" name="yhbh" required>
				<uni-easyinput v-model="formdata.yhbh" placeholder="用户编号" :border="false" />
			</uni-forms-item>
		</uni-forms>
		<view style="font-size: 12px;color: #888;">如何查询户号？</view>
		<view class="describe-dom">1、如果您办理了短信通知业务，可以在短信内容里找到;</view>
		<view class="describe-dom">2、之前的电费账单里面可以找到；</view>
		<view class="describe-dom">3、请到当地营业厅或者拨打营业厅电话查询。</view>
	</uni-card>
	<view style="padding: 0 20px 10px;">
		<button @click="formFubmit" type="primary" native-type="submit">下一步</button>
	</view>
	<!-- <uni-section  title="最近缴费" type="line" style="background: #efeff4;" />
	<uni-card :is-shadow="false" padding="0" spacing="0" margin="6">
		<uni-list :border="false" >
			<uni-list-item :border="false"  title="列表文字" note="列表描述信息" showArrow />
		</uni-list>
	</uni-card> -->
	
	
</template>

<script setup lang="ts">
	import { selectiveGetOne } from "@/api/request/selectiveGetOne";
	import { ref } from 'vue';

	let formref = ref(null)
	let formdata = ref({
		yhbh: '',
	})
	const formrules = {
		yhbh: { rules: [{ required: true, errorMessage: '请输入用户编号' }] },
	}
	
	function formFubmit() {
		formref.value.validate().then(res => {
			// console.log('表单数据信息：', res);
			selectiveGetOne( {
				data: {
					yhbh: res.yhbh,
				},
				success: (res) => {
					if(res){
						let url = '/pages/bspsd/business/payfees/payover?yhbh=' + res.yhbh
						uni.navigateTo({url: url})
					}else{
						uni.showToast({ icon: "none", title: '未查找到户号' })
					}
				},
				fail: (code, message) => {
					console.log(code, message)
				}
			})
			
		}).catch(err => {
			// console.log('表单错误信息：', err);
			uni.showToast({ icon: "none", title: err[0].errorMessage })
		})
	}
</script>

<style lang="scss" scoped>
	.describe-dom {
		color: #969799;
		font-size: 22rpx;
		line-height: 1.1
	}
</style>